# Contributor: Roberto Oliveira <robertoguimaraes8@gmail.com>
# Maintainer: Roberto Oliveira <robertoguimaraes8@gmail.com>
pkgname=perl-test-notabs
_pkgreal=Test-NoTabs
pkgver=2.02
pkgrel=3
pkgdesc="Check the presence of tabs in your project"
url="https://metacpan.org/release/Test-NoTabs/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/E/ET/ETHER/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

sha512sums="e7bd189fde1b35f67569ea702735ead8595684807491cf1635cb6a7d9360adca23d411ec1a165796afc45d55d1a724e07cecf8ddbd06206d4fe38f553954af3a  Test-NoTabs-2.02.tar.gz"
